﻿using HDJ.Framework.Core;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioPlayTestRunTime : MonoBehaviour {

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
    string chanal="0";
    string delay = "0";
    float volume;
    private void OnGUI()
    {
        chanal = GUILayout.TextField(chanal, GUILayout.MaxWidth(Screen.width / 3));
        delay = GUILayout.TextField(delay, GUILayout.MaxWidth(Screen.width / 3));

        GUILayout.BeginHorizontal();
        GUILayout.Label("总音量：");
        AudioPlayManager.TotleVolume = GUILayout.HorizontalSlider(AudioPlayManager.TotleVolume, 0, 1, GUILayout.MaxWidth(Screen.width / 2));
        GUILayout.EndHorizontal();

        if (GUILayout.Button("Music : 舞風 - 神々の祈り", GUILayout.MaxWidth(Screen.width / 3)))
        {
            AudioPlayManager.PlayMusic2D("舞風 - 神々の祈り", int.Parse( chanal),1,true,2.5f,float.Parse(delay));
        }
        if (GUILayout.Button("Music : Amateras Records - Important Lie", GUILayout.MaxWidth(Screen.width / 3)))
        {
            AudioPlayManager.PlayMusic2D("Amateras Records - Important Lie", int.Parse(chanal), 1, true, 2.5f, float.Parse(delay));
        }
        if (GUILayout.Button("Pause Play Music : Amateras Records - Important Lie", GUILayout.MaxWidth(Screen.width / 3)))
        {
            
            AudioPlayManager.PlayMusic2D("Amateras Records - Important Lie", 0);
            AudioPlayManager.PauseMusic2D(0, true);
            AudioPlayManager.PlayMusic2D("舞風 - 神々の祈り", 1);
            AudioPlayManager.PauseMusic2D(1, true);
            AudioPlayManager.PauseMusic2D(1, false);
            AudioPlayManager.PauseMusic2D(0, false);
            AudioPlayManager.PauseMusic2D(1, true);
            AudioPlayManager.PauseMusic2D(0, true);
            //AudioPlayManager.PauseMusic2D(1, false);
            //AudioPlayManager.PauseMusic2D(0, false);

        }
        GUILayout.BeginHorizontal();
        GUILayout.Label("Music音量：");
        AudioPlayManager.MusicVolume = GUILayout.HorizontalSlider(AudioPlayManager.MusicVolume, 0, 1, GUILayout.MaxWidth(Screen.width / 2));
        GUILayout.EndHorizontal();
        if (GUILayout.Button("sfx", GUILayout.MaxWidth(Screen.width / 3)))
        {
            AudioPlayManager.PlaySFX2D("interaction_hatch_close");
        }

        GUILayout.BeginHorizontal();
        GUILayout.Label("SFX音量：");
        AudioPlayManager.SFXVolume = GUILayout.HorizontalSlider(AudioPlayManager.SFXVolume, 0, 1, GUILayout.MaxWidth(Screen.width / 2));
        GUILayout.EndHorizontal();
        if (GUILayout.Button("StopMusicAll2D", GUILayout.MaxWidth(Screen.width / 3)))
        {
            AudioPlayManager.StopMusicAll2D();
        }
        if (GUILayout.Button("暂停Music"))
        {
            AudioPlayManager.PauseMusic2D(int.Parse(chanal) , true);
        }
        if (GUILayout.Button("播放Music"))
        {
            AudioPlayManager.PauseMusic2D(int.Parse(chanal), false);
        }
    }
}
